package Facades;

import Entities.Dia;
import Controllers.DiaFacade;
import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.inject.Named;
import javax.inject.Inject;
import javax.enterprise.context.SessionScoped;

@Named(value = "diaController")
@SessionScoped
public class DiaController extends AbstractController<Dia> implements Serializable {

    @Inject
    private DiaFacade ejbFacade;

    public DiaController() {
        super(Dia.class);
    }

    @PostConstruct
    public void init() {
        super.setFacade(ejbFacade);
    }

    @Override
    protected void setEmbeddableKeys() {
        this.getSelected().getDiaPK().setEmpleadoidEmpleado(this.getSelected().getEmpleado().getIdEmpleado());
    }

    @Override
    protected void initializeEmbeddableKey() {
        this.getSelected().setDiaPK(new Entities.DiaPK());
    }
}
